package src.model.gameWorld.pathfinding.movement;

import src.model.gameObject.GameObject;
import src.model.gameWorld.Position;

/**
 * <b>Overview</b>
 * Movement calculators allow pathfinders to determine how two paths are different in terms of movement costs so that the most straightforward path may be chosen.  This also allows some terrains to be impassable to some unit types.
 *
 * <b>Responsibilities</b>
 * Movement objects calculate the cost of moving in a particular Direction over a particular Terrain type.  Some terrains may be impassable to particular instances of Movement.
 *
 * <b>Collaborators</b>
 * None.
 *
 * <b>Implementor</b> - Bruce
 * <b>Tester</b> - Tim
 *
 * @author Bruce
 */
public interface Movement
{
	/**
	 * @param pathfindingTerrain the PathfindingTerrain to move over.
	 * @return <code>true</code> if the specified PathfindingTerrain is passable to this movement ability or <code>false</code> otherwise.
	 */
	public boolean validate(GameObject mover, Position pathfindingTerrain);

	/**
	 * @param direction the Direction to move in.
	 * @return <code>true</code> if the specified Direction is a legal movement Direction for this movement ability or <code>false</code> otherwise.
	 */
	public boolean canMove(Direction direction);

	/**
	 * @param direction the Direction to move in.
	 * @param pathfindingTerrain the PathfindingTerrain to move over.
	 * @return the movement cost associated with moving over the specified direction and terrain.
	 * @throws IllegalTerrainException if the Movement cannot move over the specified PathfindingTerrain.
	 * @throws IllegalDirectionException if the Movement cannot move in the specified Direction.
	 */
	public MovementCost getMovementCost(GameObject mover, Direction direction, Position pathfindingTerrain) throws IllegalTerrainException, IllegalDirectionException;
}